package me.ljd.yigo.formula;

import java.util.ArrayList;

import com.bokesoft.yigo.mid.base.DefaultContext;
import com.bokesoft.yigo.mid.parser.BaseMidFunctionImpl;
import com.bokesoft.yigo.mid.service.IExtService;
import com.bokesoft.yigo.parser.IExecutor;

import static me.ljd.yigo.utils.HandleDBQuery2.*;
/**
 * DBQuery2
 *  既可以作为中间层又可以作为service
 *  <ExtService> 
 *		<Service Name="DBQuery2Formula" Description="改变DBManager，用于多DSN" Impl="me.ljd.yigo.formula.DBQuery2Formula"/>
 *  </ExtService>
 * @author USER
 *
 */
public class DBQuery2Formula extends BaseMidFunctionImpl implements IExtService {
	//private HandleDBQuery2 handle = new HandleDBQuery2();
	@Override
	public Object doCmd(DefaultContext context, ArrayList<Object> paras) throws Throwable {
		return handle(context, paras.toArray());
	}

	@Override
	public Object evalImpl(String name, DefaultContext context, Object[] args, IExecutor executor) throws Throwable {
		return handle(context, args);
	}
}
